package utils.node;

/**
 * DESCRIPTION:
 * Author: ammar
 * Date:   2021/12/10
 * Time:   上午7:08
 */
public class ListNode {
    public int val;
    public ListNode prev;
    public ListNode next;
    public ListNode(int x) { val = x; }


    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        ListNode node = this;
        sb.append(node.val);
        int count = 15;
        while (node.next != null) {
            node = node.next;
            sb.append("-").append(node.val);
            count--;
            if (count == 0) break;
        }
        return sb.toString();
    }
}
